.class public Lcom/noshufou/android/su/service/ResultService;
.super Landroid/app/IntentService;
.source "ResultService.java"


# static fields
.field public static final ACTION_RECYCLE:I = 0x2

.field public static final ACTION_RESULT:I = 0x1

.field private static final COLUMN_ALLOW:I = 0x1

.field private static final COLUMN_ID:I = 0x0

.field private static final COLUMN_LOGGING:I = 0x3

.field private static final COLUMN_NOTIFICATIONS:I = 0x2

.field public static final EXTRA_ACTION:Ljava/lang/String; = "action"

.field public static final PROJECTION:[Ljava/lang/String; = null

.field private static final TAG:Ljava/lang/String; = "Su.ResultService"


# instance fields
.field final LAST_NOTIFICATION_TIME:Ljava/lang/String;

.field final LAST_NOTIFICATION_UID:Ljava/lang/String;

.field private mHandler:Landroid/os/Handler;

.field private mLog:Z

.field private mNotify:Z

.field private mNotifyType:Ljava/lang/String;

.field private mPrefs:Landroid/content/SharedPreferences;


# direct methods
.method static constructor <clinit>()V
    .locals 3

    .prologue
    .line 37
    const/4 v0, 0x4

    new-array v0, v0, [Ljava/lang/String;

    const/4 v1, 0x0

    .line 38
    const-string v2, "_id"

    aput-object v2, v0, v1

    const/4 v1, 0x1

    const-string v2, "allow"

    aput-object v2, v0, v1

    const/4 v1, 0x2

    const-string v2, "notifications"

    aput-object v2, v0, v1

    const/4 v1, 0x3

    const-string v2, "logging"

    aput-object v2, v0, v1

    .line 37
    sput-object v0, Lcom/noshufou/android/su/service/ResultService;->PROJECTION:[Ljava/lang/String;

    .line 27
    return-void
.end method

.method public constructor <init>()V
    .locals 2

    .prologue
    const/4 v1, 0x1

    .line 58
    const-string v0, "Su.ResultService"

    invoke-direct {p0, v0}, Landroid/app/IntentService;-><init>(Ljava/lang/String;)V

    .line 34
    const-string v0, "last_notification_uid"

    iput-object v0, p0, Lcom/noshufou/android/su/service/ResultService;->LAST_NOTIFICATION_UID:Ljava/lang/String;

    .line 35
    const-string v0, "last_notification_time"

    iput-object v0, p0, Lcom/noshufou/android/su/service/ResultService;->LAST_NOTIFICATION_TIME:Ljava/lang/String;

    .line 50
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/noshufou/android/su/service/ResultService;->mPrefs:Landroid/content/SharedPreferences;

    .line 51
    iput-boolean v1, p0, Lcom/noshufou/android/su/service/ResultService;->mNotify:Z

    .line 52
    const-string v0, "toast"

    iput-object v0, p0, Lcom/noshufou/android/su/service/ResultService;->mNotifyType:Ljava/lang/String;

    .line 53
    iput-boolean v1, p0, Lcom/noshufou/android/su/service/ResultService;->mLog:Z

    .line 59
    return-void
.end method

.method private addLog(JIILjava/lang/String;IJLjava/lang/String;)V
    .locals 4
    .parameter "appId"
    .parameter "callerUid"
    .parameter "execUid"
    .parameter "execCmd"
    .parameter "allow"
    .parameter "currentTime"
    .parameter "appLog"

    .prologue
    const/4 v3, -0x1

    .line 165
    if-nez p9, :cond_0

    iget-boolean v1, p0, Lcom/noshufou/android/su/service/ResultService;->mLog:Z

    if-eqz v1, :cond_2

    .line 166
    :cond_0
    if-eqz p9, :cond_1

    const-string v1, "0"

    invoke-virtual {p9, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-nez v1, :cond_2

    .line 167
    :cond_1
    if-ne p6, v3, :cond_3

    .line 189
    :cond_2
    :goto_0
    return-void

    .line 171
    :cond_3
    new-instance v0, Landroid/content/ContentValues;

    invoke-direct {v0}, Landroid/content/ContentValues;-><init>()V

    .line 172
    .local v0, values:Landroid/content/ContentValues;
    const-wide/16 v1, -0x1

    cmp-long v1, p1, v1

    if-nez v1, :cond_4

    .line 174
    const-string v1, "uid"

    invoke-static {p3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 175
    const-string v1, "package"

    invoke-static {p0, p3}, Lcom/noshufou/android/su/util/Util;->getAppPackage(Landroid/content/Context;I)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 176
    const-string v1, "name"

    const/4 v2, 0x0

    invoke-static {p0, p3, v2}, Lcom/noshufou/android/su/util/Util;->getAppName(Landroid/content/Context;IZ)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 177
    const-string v1, "exec_uid"

    invoke-static {p4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 178
    const-string v1, "exec_cmd"

    invoke-virtual {v0, v1, p5}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 179
    const-string v1, "allow"

    invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 180
    invoke-virtual {p0}, Lcom/noshufou/android/su/service/ResultService;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v1

    sget-object v2, Lcom/noshufou/android/su/provider/PermissionsProvider$Apps;->CONTENT_URI:Landroid/net/Uri;

    invoke-virtual {v1, v2, v0}, Landroid/content/ContentResolver;->insert(Landroid/net/Uri;Landroid/content/ContentValues;)Landroid/net/Uri;

    move-result-object v1

    .line 181
    invoke-virtual {v1}, Landroid/net/Uri;->getLastPathSegment()Ljava/lang/String;

    move-result-object v1

    .line 180
    invoke-static {v1}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J

    move-result-wide p1

    .line 184
    :cond_4
    invoke-virtual {v0}, Landroid/content/ContentValues;->clear()V

    .line 185
    const-string v1, "date"

    invoke-static {p7, p8}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Long;)V

    .line 186
    const-string v1, "type"

    invoke-static {p6}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 187
    invoke-virtual {p0}, Lcom/noshufou/android/su/service/ResultService;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v1

    .line 188
    sget-object v2, Lcom/noshufou/android/su/provider/PermissionsProvider$Logs;->CONTENT_URI:Landroid/net/Uri;

    invoke-static {p1, p2}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;

    move-result-object v3

    invoke-static {v2, v3}, Landroid/net/Uri;->withAppendedPath(Landroid/net/Uri;Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v2

    invoke-virtual {v1, v2, v0}, Landroid/content/ContentResolver;->insert(Landroid/net/Uri;Landroid/content/ContentValues;)Landroid/net/Uri;

    goto :goto_0
.end method

.method private ensurePrefs()V
    .locals 4

    .prologue
    const/4 v3, 0x1

    .line 217
    iget-object v0, p0, Lcom/noshufou/android/su/service/ResultService;->mPrefs:Landroid/content/SharedPreferences;

    if-nez v0, :cond_0

    .line 218
    invoke-static {p0}, Landroid/preference/PreferenceManager;->getDefaultSharedPreferences(Landroid/content/Context;)Landroid/content/SharedPreferences;

    move-result-object v0

    iput-object v0, p0, Lcom/noshufou/android/su/service/ResultService;->mPrefs:Landroid/content/SharedPreferences;

    .line 220
    iget-object v0, p0, Lcom/noshufou/android/su/service/ResultService;->mPrefs:Landroid/content/SharedPreferences;

    const-string v1, "pref_notifications"

    invoke-interface {v0, v1, v3}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z

    move-result v0

    iput-boolean v0, p0, Lcom/noshufou/android/su/service/ResultService;->mNotify:Z

    .line 221
    iget-object v0, p0, Lcom/noshufou/android/su/service/ResultService;->mPrefs:Landroid/content/SharedPreferences;

    const-string v1, "pref_notification_type"

    const-string v2, "toast"

    invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/noshufou/android/su/service/ResultService;->mNotifyType:Ljava/lang/String;

    .line 222
    iget-object v0, p0, Lcom/noshufou/android/su/service/ResultService;->mPrefs:Landroid/content/SharedPreferences;

    const-string v1, "pref_logging"

    invoke-interface {v0, v1, v3}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z

    move-result v0

    iput-boolean v0, p0, Lcom/noshufou/android/su/service/ResultService;->mLog:Z

    .line 224
    :cond_0
    return-void
.end method

.method private recycle()V
    .locals 13

    .prologue
    const/4 v12, 0x1

    const/4 v3, 0x0

    const/4 v11, 0x0

    .line 192
    invoke-direct {p0}, Lcom/noshufou/android/su/service/ResultService;->ensurePrefs()V

    .line 193
    iget-object v0, p0, Lcom/noshufou/android/su/service/ResultService;->mPrefs:Landroid/content/SharedPreferences;

    const-string v1, "pref_delete_old_logs"

    invoke-interface {v0, v1, v12}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z

    move-result v0

    if-nez v0, :cond_1

    .line 214
    :cond_0
    return-void

    .line 198
    :cond_1
    iget-object v0, p0, Lcom/noshufou/android/su/service/ResultService;->mPrefs:Landroid/content/SharedPreferences;

    const-string v1, "pref_log_entry_limit"

    const/16 v2, 0xc8

    invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getInt(Ljava/lang/String;I)I

    move-result v10

    .line 199
    .local v10, limit:I
    invoke-virtual {p0}, Lcom/noshufou/android/su/service/ResultService;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    sget-object v1, Lcom/noshufou/android/su/provider/PermissionsProvider$Logs;->CONTENT_URI:Landroid/net/Uri;

    new-array v2, v12, [Ljava/lang/String;

    const-string v4, "COUNT() as rows"

    aput-object v4, v2, v11

    move-object v4, v3

    move-object v5, v3

    invoke-virtual/range {v0 .. v5}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v6

    .line 201
    .local v6, c:Landroid/database/Cursor;
    invoke-interface {v6}, Landroid/database/Cursor;->moveToFirst()Z

    .line 202
    invoke-interface {v6, v11}, Landroid/database/Cursor;->getInt(I)I

    move-result v7

    .line 203
    .local v7, count:I
    invoke-interface {v6}, Landroid/database/Cursor;->close()V

    .line 204
    if-le v7, v10, :cond_0

    .line 205
    invoke-virtual {p0}, Lcom/noshufou/android/su/service/ResultService;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    sget-object v1, Lcom/noshufou/android/su/provider/PermissionsProvider$Logs;->CONTENT_URI:Landroid/net/Uri;

    new-array v2, v12, [Ljava/lang/String;

    const-string v4, "_id"

    aput-object v4, v2, v11

    .line 206
    const-string v5, "date ASC"

    move-object v4, v3

    .line 205
    invoke-virtual/range {v0 .. v5}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v6

    .line 207
    const-wide/16 v8, 0x0

    .line 208
    .local v8, id:J
    :goto_0
    if-le v7, v10, :cond_0

    invoke-interface {v6}, Landroid/database/Cursor;->moveToNext()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 209
    invoke-interface {v6, v11}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v8

    .line 210
    invoke-virtual {p0}, Lcom/noshufou/android/su/service/ResultService;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    sget-object v1, Lcom/noshufou/android/su/provider/PermissionsProvider$Logs;->CONTENT_URI:Landroid/net/Uri;

    const-string v2, "_id=?"

    .line 211
    new-array v3, v12, [Ljava/lang/String;

    invoke-static {v8, v9}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;

    move-result-object v4

    aput-object v4, v3, v11

    invoke-virtual {v0, v1, v2, v3}, Landroid/content/ContentResolver;->delete(Landroid/net/Uri;Ljava/lang/String;[Ljava/lang/String;)I

    move-result v0

    sub-int/2addr v7, v0

    goto :goto_0
.end method

.method private sendNotification(JIIJLjava/lang/String;)V
    .locals 16
    .parameter "appId"
    .parameter "callerUid"
    .parameter "allow"
    .parameter "currentTime"
    .parameter "appNotify"

    .prologue
    .line 113
    if-nez p7, :cond_0

    move-object/from16 v0, p0

    iget-boolean v12, v0, Lcom/noshufou/android/su/service/ResultService;->mNotify:Z

    if-eqz v12, :cond_2

    .line 114
    :cond_0
    if-eqz p7, :cond_1

    const-string v12, "0"

    move-object/from16 v0, p7

    invoke-virtual {v0, v12}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v12

    if-nez v12, :cond_2

    .line 115
    :cond_1
    const/4 v12, -0x1

    move/from16 v0, p4

    if-ne v0, v12, :cond_3

    .line 160
    :cond_2
    :goto_0
    return-void

    .line 119
    :cond_3
    const/4 v12, 0x1

    move/from16 v0, p4

    if-ne v0, v12, :cond_5

    const v12, 0x7f0b00ae

    :goto_1
    const/4 v13, 0x1

    new-array v13, v13, [Ljava/lang/Object;

    const/4 v14, 0x0

    .line 120
    const/4 v15, 0x0

    move-object/from16 v0, p0

    move/from16 v1, p3

    invoke-static {v0, v1, v15}, Lcom/noshufou/android/su/util/Util;->getAppName(Landroid/content/Context;IZ)Ljava/lang/String;

    move-result-object v15

    aput-object v15, v13, v14

    .line 118
    move-object/from16 v0, p0

    invoke-virtual {v0, v12, v13}, Lcom/noshufou/android/su/service/ResultService;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v11

    .line 121
    .local v11, notificationMessage:Ljava/lang/String;
    move-object/from16 v0, p0

    iget-object v12, v0, Lcom/noshufou/android/su/service/ResultService;->mNotifyType:Ljava/lang/String;

    const-string v13, "toast"

    invoke-virtual {v12, v13}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v12

    if-eqz v12, :cond_6

    .line 122
    invoke-direct/range {p0 .. p0}, Lcom/noshufou/android/su/service/ResultService;->ensurePrefs()V

    .line 123
    move-object/from16 v0, p0

    iget-object v12, v0, Lcom/noshufou/android/su/service/ResultService;->mPrefs:Landroid/content/SharedPreferences;

    const-string v13, "last_notification_uid"

    const/4 v14, 0x0

    invoke-interface {v12, v13, v14}, Landroid/content/SharedPreferences;->getInt(Ljava/lang/String;I)I

    move-result v7

    .line 124
    .local v7, lastNotificationUid:I
    move-object/from16 v0, p0

    iget-object v12, v0, Lcom/noshufou/android/su/service/ResultService;->mPrefs:Landroid/content/SharedPreferences;

    const-string v13, "last_notification_time"

    const-wide/16 v14, 0x0

    invoke-interface {v12, v13, v14, v15}, Landroid/content/SharedPreferences;->getLong(Ljava/lang/String;J)J

    move-result-wide v5

    .line 125
    .local v5, lastNotificationTime:J
    move-object/from16 v0, p0

    iget-object v12, v0, Lcom/noshufou/android/su/service/ResultService;->mPrefs:Landroid/content/SharedPreferences;

    const-string v13, "pref_toast_location"

    const-string v14, "0"

    invoke-interface {v12, v13, v14}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v12

    invoke-static {v12}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v4

    .line 126
    .local v4, gravity:I
    move/from16 v0, p3

    if-ne v7, v0, :cond_4

    .line 127
    const-wide/16 v12, 0x1388

    add-long/2addr v12, v5

    cmp-long v12, v12, p5

    if-gez v12, :cond_2

    .line 128
    :cond_4
    move-object/from16 v0, p0

    iget-object v12, v0, Lcom/noshufou/android/su/service/ResultService;->mHandler:Landroid/os/Handler;

    new-instance v13, Lcom/noshufou/android/su/service/ResultService$1;

    move-object/from16 v0, p0

    invoke-direct {v13, v0, v11, v4}, Lcom/noshufou/android/su/service/ResultService$1;-><init>(Lcom/noshufou/android/su/service/ResultService;Ljava/lang/String;I)V

    invoke-virtual {v12, v13}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    .line 141
    move-object/from16 v0, p0

    iget-object v12, v0, Lcom/noshufou/android/su/service/ResultService;->mPrefs:Landroid/content/SharedPreferences;

    invoke-interface {v12}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v3

    .line 142
    .local v3, editor:Landroid/content/SharedPreferences$Editor;
    const-string v12, "last_notification_uid"

    move/from16 v0, p3

    invoke-interface {v3, v12, v0}, Landroid/content/SharedPreferences$Editor;->putInt(Ljava/lang/String;I)Landroid/content/SharedPreferences$Editor;

    .line 143
    const-string v12, "last_notification_time"

    move-wide/from16 v0, p5

    invoke-interface {v3, v12, v0, v1}, Landroid/content/SharedPreferences$Editor;->putLong(Ljava/lang/String;J)Landroid/content/SharedPreferences$Editor;

    .line 144
    invoke-interface {v3}, Landroid/content/SharedPreferences$Editor;->commit()Z

    goto/16 :goto_0

    .line 119
    .end local v3           #editor:Landroid/content/SharedPreferences$Editor;
    .end local v4           #gravity:I
    .end local v5           #lastNotificationTime:J
    .end local v7           #lastNotificationUid:I
    .end local v11           #notificationMessage:Ljava/lang/String;
    :cond_5
    const v12, 0x7f0b00af

    goto/16 :goto_1

    .line 146
    .restart local v11       #notificationMessage:Ljava/lang/String;
    :cond_6
    move-object/from16 v0, p0

    iget-object v12, v0, Lcom/noshufou/android/su/service/ResultService;->mNotifyType:Ljava/lang/String;

    const-string v13, "status"

    invoke-virtual {v12, v13}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v12

    if-eqz v12, :cond_2

    .line 148
    const-string v12, "notification"

    move-object/from16 v0, p0

    invoke-virtual {v0, v12}, Lcom/noshufou/android/su/service/ResultService;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v8

    check-cast v8, Landroid/app/NotificationManager;

    .line 149
    .local v8, nm:Landroid/app/NotificationManager;
    new-instance v10, Landroid/content/Intent;

    const-class v12, Lcom/noshufou/android/su/HomeActivity;

    move-object/from16 v0, p0

    invoke-direct {v10, v0, v12}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 151
    .local v10, notificationIntent:Landroid/content/Intent;
    const/4 v12, 0x0

    .line 152
    const/4 v13, 0x0

    .line 151
    move-object/from16 v0, p0

    invoke-static {v0, v12, v10, v13}, Landroid/app/PendingIntent;->getActivity(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;

    move-result-object v2

    .line 153
    .local v2, contentIntent:Landroid/app/PendingIntent;
    new-instance v9, Landroid/app/Notification;

    const v12, 0x7f020034

    move-wide/from16 v0, p5

    invoke-direct {v9, v12, v11, v0, v1}, Landroid/app/Notification;-><init>(ILjava/lang/CharSequence;J)V

    .line 155
    .local v9, notification:Landroid/app/Notification;
    const/high16 v12, 0x7f0b

    move-object/from16 v0, p0

    invoke-virtual {v0, v12}, Lcom/noshufou/android/su/service/ResultService;->getString(I)Ljava/lang/String;

    move-result-object v12

    move-object/from16 v0, p0

    invoke-virtual {v9, v0, v12, v11, v2}, Landroid/app/Notification;->setLatestEventInfo(Landroid/content/Context;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Landroid/app/PendingIntent;)V

    .line 157
    iget v12, v9, Landroid/app/Notification;->flags:I

    or-int/lit8 v12, v12, 0x18

    iput v12, v9, Landroid/app/Notification;->flags:I

    .line 158
    move/from16 v0, p3

    invoke-virtual {v8, v0, v9}, Landroid/app/NotificationManager;->notify(ILandroid/app/Notification;)V

    goto/16 :goto_0
.end method


# virtual methods
.method public onCreate()V
    .locals 1

    .prologue
    .line 63
    invoke-super {p0}, Landroid/app/IntentService;->onCreate()V

    .line 65
    new-instance v0, Landroid/os/Handler;

    invoke-direct {v0}, Landroid/os/Handler;-><init>()V

    iput-object v0, p0, Lcom/noshufou/android/su/service/ResultService;->mHandler:Landroid/os/Handler;

    .line 66
    return-void
.end method

.method protected onHandleIntent(Landroid/content/Intent;)V
    .locals 24
    .parameter "intent"

    .prologue
    .line 70
    const-string v1, "action"

    const/4 v4, 0x0

    move-object/from16 v0, p1

    invoke-virtual {v0, v1, v4}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I

    move-result v1

    packed-switch v1, :pswitch_data_0

    .line 107
    new-instance v1, Ljava/lang/IllegalArgumentException;

    invoke-direct {v1}, Ljava/lang/IllegalArgumentException;-><init>()V

    throw v1

    .line 72
    :pswitch_0
    invoke-direct/range {p0 .. p0}, Lcom/noshufou/android/su/service/ResultService;->ensurePrefs()V

    .line 73
    const-string v1, "caller_uid"

    const/4 v4, 0x0

    move-object/from16 v0, p1

    invoke-virtual {v0, v1, v4}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I

    move-result v12

    .line 74
    .local v12, callerUid:I
    const-string v1, "allow"

    const/4 v4, -0x1

    move-object/from16 v0, p1

    invoke-virtual {v0, v1, v4}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I

    move-result v19

    .line 75
    .local v19, allow:I
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v16

    .line 77
    .local v16, currentTime:J
    const-wide/16 v20, -0x1

    .line 78
    .local v20, appId:J
    const/4 v8, 0x0

    .line 79
    .local v8, appNotify:Ljava/lang/String;
    const/16 v18, 0x0

    .line 82
    .local v18, appLog:Ljava/lang/String;
    invoke-virtual/range {p0 .. p0}, Lcom/noshufou/android/su/service/ResultService;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v1

    .line 83
    sget-object v4, Lcom/noshufou/android/su/provider/PermissionsProvider$Apps;->CONTENT_URI:Landroid/net/Uri;

    .line 84
    new-instance v6, Ljava/lang/StringBuilder;

    const-string v7, "uid/"

    invoke-direct {v6, v7}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v6, v12}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    .line 83
    invoke-static {v4, v6}, Landroid/net/Uri;->withAppendedPath(Landroid/net/Uri;Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v2

    .line 85
    sget-object v3, Lcom/noshufou/android/su/service/ResultService;->PROJECTION:[Ljava/lang/String;

    .line 86
    const/4 v4, 0x0

    const/4 v5, 0x0

    const/4 v6, 0x0

    .line 82
    invoke-virtual/range {v1 .. v6}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v22

    .line 87
    .local v22, c:Landroid/database/Cursor;
    if-eqz v22, :cond_1

    invoke-interface/range {v22 .. v22}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v1

    if-eqz v1, :cond_1

    .line 88
    const/4 v1, 0x0

    move-object/from16 v0, v22

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v2

    .line 89
    .end local v20           #appId:J
    .local v2, appId:J
    const/4 v1, 0x2

    move-object/from16 v0, v22

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v8

    .line 90
    const/4 v1, 0x3

    move-object/from16 v0, v22

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v18

    .line 91
    const/4 v1, 0x1

    move-object/from16 v0, v22

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getInt(I)I

    move-result v23

    .line 92
    .local v23, dbAllow:I
    const/4 v1, -0x1

    move/from16 v0, v23

    if-eq v0, v1, :cond_0

    .line 93
    move/from16 v5, v23

    .line 96
    .end local v19           #allow:I
    .end local v23           #dbAllow:I
    .local v5, allow:I
    :goto_0
    invoke-interface/range {v22 .. v22}, Landroid/database/Cursor;->close()V

    move-object/from16 v1, p0

    move v4, v12

    move-wide/from16 v6, v16

    .line 98
    invoke-direct/range {v1 .. v8}, Lcom/noshufou/android/su/service/ResultService;->sendNotification(JIIJLjava/lang/String;)V

    .line 99
    const-string v1, "desired_uid"

    const/4 v4, 0x0

    move-object/from16 v0, p1

    invoke-virtual {v0, v1, v4}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I

    move-result v13

    .line 100
    const-string v1, "desired_cmd"

    move-object/from16 v0, p1

    invoke-virtual {v0, v1}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v14

    move-object/from16 v9, p0

    move-wide v10, v2

    move v15, v5

    .line 99
    invoke-direct/range {v9 .. v18}, Lcom/noshufou/android/su/service/ResultService;->addLog(JIILjava/lang/String;IJLjava/lang/String;)V

    .line 104
    .end local v2           #appId:J
    .end local v5           #allow:I
    .end local v8           #appNotify:Ljava/lang/String;
    .end local v12           #callerUid:I
    .end local v16           #currentTime:J
    .end local v18           #appLog:Ljava/lang/String;
    .end local v22           #c:Landroid/database/Cursor;
    :pswitch_1
    invoke-direct/range {p0 .. p0}, Lcom/noshufou/android/su/service/ResultService;->recycle()V

    .line 109
    return-void

    .restart local v2       #appId:J
    .restart local v8       #appNotify:Ljava/lang/String;
    .restart local v12       #callerUid:I
    .restart local v16       #currentTime:J
    .restart local v18       #appLog:Ljava/lang/String;
    .restart local v19       #allow:I
    .restart local v22       #c:Landroid/database/Cursor;
    .restart local v23       #dbAllow:I
    :cond_0
    move/from16 v5, v19

    .end local v19           #allow:I
    .restart local v5       #allow:I
    goto :goto_0

    .end local v2           #appId:J
    .end local v5           #allow:I
    .end local v23           #dbAllow:I
    .restart local v19       #allow:I
    .restart local v20       #appId:J
    :cond_1
    move-wide/from16 v2, v20

    .end local v20           #appId:J
    .restart local v2       #appId:J
    move/from16 v5, v19

    .end local v19           #allow:I
    .restart local v5       #allow:I
    goto :goto_0

    .line 70
    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_0
        :pswitch_1
    .end packed-switch
.end method
